<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml">
	<head th:replace="admin/_fragments::head(~{::title})" >
		<meta charset="utf-8">
		<!-- 设置移动端更好的适配以及预览 -->
		<meta name="viewport" content="width=device-width,initial-scale=1.0">
		<title>博客分类管理</title>
		<!-- 引入semantic-ui的css和js -->
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
		<link rel="stylesheet" href="../../static/css/me.css"/>
	</head>
	<body>
		<!-- 导航栏部分 -->
		<nav th:replace="~{admin/_fragments::menu(2)}" class="ui inverted attached segment m-padded-tb-mini m-shadow-small"><!-- inverted是反转的意思，默认效果是圆角的，我们可以使用attached是去除圆角 -->
			<div class="ui container">
				<div class="ui inverted secondary stackable menu">
					<h2 class="ui blue header item">Blog管理后台</h2>
					<a href="#" class="item menu-item m-mobile-hide"><i class="home icon"></i>博客</a>
					<a href="#" class="item menu-item m-mobile-hide"><i class="idea icon"></i>分类</a>
					<a href="#" class="item menu-item m-mobile-hide"><i class="tags icon"></i>标签</a>
					<div class="right menu-item m-mobile-hide menu">
						<div class="ui dropdown item">
							<div class="text">
								<img class="ui avatar image" src="../../static/images/huazai.png" />
								龙哥
							</div>
							<i class="dropdown icon"></i>
							<div class="menu">
								<a href="#" class="item">注销</a>
							</div>
						</div>
					</div>

				</div>
			</div>
			<!--绑定css样式:手机端显示，电脑端隐藏
				绑定js：当点击的时候，上面的菜单栏显示和隐藏进行切换。
			-->
			<a href="#" class="ui menu toggle black icon button m-top-right m-mobile-show">
				<i class="sidebar icon"></i>
			</a>
		</nav>
		<!--二级导航部分-->
		<div class="ui container">
			<div class="ui right attached pointing menu">
				<a href="#" th:href="@{/admin/types}" class="active item">列表</a>
				<a href="#" th:href="@{/admin/types/input}" class="item">发布</a>
			</div>
		</div>


		<!-- 存放主体内容 -->
		<div class="m-padded-tb-big m-container-small">
			<div class="ui container">
				<!--信息提示框：message组件
					th:unless：信息不为空则展示，不存在则隐藏。
				-->
				<div class="ui success message" th:unless="${#strings.isEmpty(message)}">
					<i class="close icon"></i>
					<div class="header">提示：</div>
					<p th:text="${message}">恭喜添加成功！！</p>
				</div>

				<!--主要信息展示区域：展示分类列表-->
				<table class="ui table">
					<thead>
						<tr>
							<th></th>
							<th>名称</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<tr th:each="type,itemStart: ${page.content}">
							<td th:text="${itemStart.count}">1</td>
							<td th:text="${type.name}">认知升级</td>
							<td>
								<a href="#" th:href="@{/admin/types/{id}/input(id=${type.id})}" class="ui mini blue basic button">编辑</a>
								<a href="#" th:href="@{/admin/types/{id}/delete(id=${type.id})}" class="ui mini red basic button">删除</a>
							</td>
						</tr>
					</tbody>
					<tfoot>
						<tr>
							<th colspan="6">
								<div class="ui mini right floated pagination menu"  th:if="${page.totalPages}>1">
									<a  th:href="@{/admin/types(page=${page.number}-1)}" th:unless="${page.isFirst()}" class="item">上一页</a>
									<a  th:href="@{/admin/types(page=${page.number}+1)}" th:unless="${page.isLast()}" class="item">下一页</a>
								</div>
								<a href="#" th:href="@{/admin/types/input}"  class="ui mini green basic button">
									新增
									<i class="add icon"></i>
								</a>
							</th>
						</tr>
					</tfoot>
				</table>
			</div>
		</div>

		<br />
		<br />
		<br />
		<br />
		<br />
		<br />

		<!-- 存放底部footer -->
		<!-- vertical:垂直的，默认情况下segment是圆角，-->
		<footer th:replace="admin/_fragments::footer" class="ui inverted vertical segment m-padded-tb-big">
			<!--设置一个居中的容器-->
			<div class="ui center aligned container">
				<!--grid:垂直划分，默认是16份；
					inverted divided：采用分割线  -->
				<div class="ui inverted stackable divided grid">
					<!--存放左边的二维码-->
					<diV class="three wide column">
						<div class="ui inverted link list">
							<div class="item">
								<!--rounded：设置图片为圆角-->
								<img src="../../static/images/wechat.jpg" class="ui rounded image" alt="图片加载失败" style="width: 100px;height: 100px;"/>
							</div>
						</div>
					</diV>
					<!--存放最新博客的信息-->
					<diV class="three wide column">
						<h4 class="ui inverted header  m-text-spaced m-opacity-mini">最新博客</h4>
						<div class="ui inverted link list">
							<a href="#" class="item">用户故事</a>
							<a href="#" class="item">早期的鸟儿有虫吃</a>
							<a href="#" class="item">早期的虫儿被鸟吃</a>
						</div>
					</diV>
					<!--存放联系我的相关信息-->
					<diV class="three wide column">
						<h4 class="ui inverted header m-text-spaced m-opacity-mini">联系我</h4>
						<div class="ui inverted link list">
							<a href="#" class="item">Email：p15194420545@163.com</a>
							<a href="#" class="item">QQ：1753853993</a>
						</div>
					</diV>
					<!--右侧的论坛介绍-->
					<diV class="seven wide column">
						<h4 class="ui inverted header m-text-spaced m-opacity-mini">论坛show</h4>
						<p class=" m-opacity-mini">这是我的个人博客，会分享一些关于编程，写作，思考相关的内容，希望可以给来到这里的人有所帮助...</p>
					</diV>
				</div>
				<!---->
				<div class="ui inverted section divider"></div>
				<p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright © 2016 - 2017 Lirenmi Designed by Lirenmi</p>
			</div>
			
		</footer>

		
		<!-- js文件依赖jquery，因此我们需要引入jquery -->
		<script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
		<script type="text/javascript">
			$('.menu.toggle').click(function (){
				$('.menu-item').toggleClass('m-mobile-hide');
			});
			$('.ui.dropdown').dropdown({
				on:'hover'
			});
			/*注意这里的空格*/
			$('.message .close').on('click',function () {
				$(this).closest('.message').transition('fade');
			})
		</script>
	</body>
</html>
